<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 * Description of MY_AcxException.php
 *
 * @author nhchung
 * @since Feb 16, 2012 - 3:15:56 PM
 */
class MY_AcxException extends CI_Exceptions
{
	private $error_no;
	private $error_msg;
	
	function __construct($error_no=0, $error_msg=""){
		parent::__construct();
		$this->error_no = $error_no;
		$this->error_msg = $error_msg;
	}
	
	/**
	 * get_error_no
	 * 
	 * Get the error no
	 * @return number
	 */
	public function get_error_no(){
		return $this->error_no;
	}
	
	/**
	 * get_error_msg
	 * 
	 * Get the error message
	 * @return string
	 */
	public function get_error_msg(){
		return $this->error_msg;
	}
	
	/**
	 * to_json
	 * 
	 * Convert AcxException object to json string
	 * @return string
	 */
	public function to_json(){
		$json_array = array("error_no" => $this->error_no,
				"error_msg" => $this->error_msg
		);
		return json_encode($json_array);
	}
	
	
} 